SpatialStream® Code Examples

Great School District Ratings

This example demonstrates how to simply add layers to a map using a Map Layer object. The map layer uses the GetMap functional component to construct web requests and retrieve images, in this case Great Schools Data , to display on the map.

GetMap

layer = new Dmp.Layer.WmsLayer("SD", "SS");
layer.addChild("poly", "SS.Admin.GS.SchoolDistricts/SchoolDistricts", "PUBLIC_FOLDER/Styles/GreatSchoolScores/District.Rating.sld.xml", {
zIndex: 100, zoomRange: {
min: 4, max: 19
}
});
layer.addChild("label", "SS.Admin.GS.SchoolDistricts/SchoolDistricts", "PUBLIC_FOLDER/Styles/GreatSchoolScores/Lables.sld.xml", {
zIndex: 100, zoomRange: {
min: 12, max: 19
}
});
map.addEntity(layer);

//----------------

var url = "Identify.aspx" +
"?returnGeoType=3" +
"&dataSource=SS.Admin.GS.SchoolDistricts/SchoolDistricts" +
"&showSchema=false" +
"&lat=" + loc.latitude +
"&long=" + loc.longitude +
"&fields=*";

Dmp.Env.Connections["SS"].getJson(url, successCallback, errorCallback);


Run Sample   Back To Index